import { Modal } from 'ant-design-vue';

/**
 * 通用的确认对话框
 * @param content 提示内容
 * @param title 提示标题
 * @returns Promise
 */
export function Confirm(content: string, title: string) {
  return new Promise((resolve, reject) => {
    Modal.confirm({
      content,
      onCancel() {
        reject(new Error('已取消'));
      },
      onOk() {
        resolve(true);
      },
      title,
    });
  });
}
